namespace Ds.DataBase.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitData : DbMigration
    {
        public override void Up()
        {
            AddColumn("dbo.ZhiWeis", "ZhiWei_zwid", c => c.Int());
            AddColumn("dbo.PowerTrees", "PowerTree_ptid", c => c.Int());
            AlterColumn("dbo.KeShis", "ksmc", c => c.String());
            CreateIndex("dbo.ZhiWeis", "ZhiWei_zwid");
            CreateIndex("dbo.PowerTrees", "PowerTree_ptid");
            AddForeignKey("dbo.PowerTrees", "PowerTree_ptid", "dbo.PowerTrees", "ptid");
            AddForeignKey("dbo.ZhiWeis", "ZhiWei_zwid", "dbo.ZhiWeis", "zwid");
            DropColumn("dbo.ZhiWeis", "zwpid");
            DropColumn("dbo.PowerTrees", "ptpid");
        }
        
        public override void Down()
        {
            AddColumn("dbo.PowerTrees", "ptpid", c => c.Int(nullable: false));
            AddColumn("dbo.ZhiWeis", "zwpid", c => c.Int(nullable: false));
            DropForeignKey("dbo.ZhiWeis", "ZhiWei_zwid", "dbo.ZhiWeis");
            DropForeignKey("dbo.PowerTrees", "PowerTree_ptid", "dbo.PowerTrees");
            DropIndex("dbo.PowerTrees", new[] { "PowerTree_ptid" });
            DropIndex("dbo.ZhiWeis", new[] { "ZhiWei_zwid" });
            AlterColumn("dbo.KeShis", "ksmc", c => c.Int(nullable: false));
            DropColumn("dbo.PowerTrees", "PowerTree_ptid");
            DropColumn("dbo.ZhiWeis", "ZhiWei_zwid");
        }
    }
}
